.class final Lcom/evernote/client/android/AsyncReflector$1;
.super Ljava/lang/Object;
.source "AsyncReflector.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/evernote/client/android/AsyncReflector;->execute(Ljava/lang/Object;Lcom/evernote/client/android/OnClientCallback;Ljava/lang/String;[Ljava/lang/Object;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation


# instance fields
.field final synthetic val$args:[Ljava/lang/Object;

.field final synthetic val$callback:Lcom/evernote/client/android/OnClientCallback;

.field final synthetic val$function:Ljava/lang/String;

.field final synthetic val$handler:Landroid/os/Handler;

.field final synthetic val$receiver:Ljava/lang/Object;


# direct methods
.method constructor <init>([Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;Landroid/os/Handler;Lcom/evernote/client/android/OnClientCallback;)V
    .registers 6

    .prologue
    .line 41
    iput-object p1, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$args:[Ljava/lang/Object;

    iput-object p2, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$receiver:Ljava/lang/Object;

    iput-object p3, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$function:Ljava/lang/String;

    iput-object p4, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$handler:Landroid/os/Handler;

    iput-object p5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$callback:Lcom/evernote/client/android/OnClientCallback;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .registers 8

    .prologue
    .line 44
    :try_start_0
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$args:[Ljava/lang/Object;

    array-length v5, v5

    new-array v1, v5, [Ljava/lang/Class;

    .line 45
    .local v1, "classes":[Ljava/lang/Class;
    const/4 v3, 0x0

    .local v3, "i":I
    :goto_6
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$args:[Ljava/lang/Object;

    array-length v5, v5

    if-ge v3, v5, :cond_47

    .line 47
    sget-object v5, Lcom/evernote/client/android/AsyncReflector;->PRIMITIVE_MAP:Ljava/util/Map;

    iget-object v6, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$args:[Ljava/lang/Object;

    aget-object v6, v6, v3

    invoke-virtual {v6}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v6

    invoke-interface {v5, v6}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_30

    .line 48
    sget-object v5, Lcom/evernote/client/android/AsyncReflector;->PRIMITIVE_MAP:Ljava/util/Map;

    iget-object v6, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$args:[Ljava/lang/Object;

    aget-object v6, v6, v3

    invoke-virtual {v6}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v6

    invoke-interface {v5, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/Class;

    aput-object v5, v1, v3

    .line 45
    :goto_2d
    add-int/lit8 v3, v3, 0x1

    goto :goto_6

    .line 50
    :cond_30
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$args:[Ljava/lang/Object;

    aget-object v5, v5, v3

    invoke-virtual {v5}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v5

    aput-object v5, v1, v3
    :try_end_3a
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_3a} :catch_3b

    goto :goto_2d

    .line 72
    .end local v1    # "classes":[Ljava/lang/Class;
    .end local v3    # "i":I
    :catch_3b
    move-exception v2

    .line 73
    .local v2, "ex":Ljava/lang/Exception;
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$handler:Landroid/os/Handler;

    new-instance v6, Lcom/evernote/client/android/AsyncReflector$1$2;

    invoke-direct {v6, p0, v2}, Lcom/evernote/client/android/AsyncReflector$1$2;-><init>(Lcom/evernote/client/android/AsyncReflector$1;Ljava/lang/Exception;)V

    invoke-virtual {v5, v6}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 80
    .end local v2    # "ex":Ljava/lang/Exception;
    :goto_46
    return-void

    .line 54
    .restart local v1    # "classes":[Ljava/lang/Class;
    .restart local v3    # "i":I
    :cond_47
    const/4 v4, 0x0

    .line 55
    .local v4, "method":Ljava/lang/reflect/Method;
    :try_start_48
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$receiver:Ljava/lang/Object;

    instance-of v5, v5, Ljava/lang/Class;

    if-eqz v5, :cond_6b

    .line 57
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$receiver:Ljava/lang/Object;

    check-cast v5, Ljava/lang/Class;

    iget-object v6, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$function:Ljava/lang/String;

    invoke-virtual {v5, v6, v1}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v4

    .line 63
    :goto_58
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$receiver:Ljava/lang/Object;

    iget-object v6, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$args:[Ljava/lang/Object;

    invoke-virtual {v4, v5, v6}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    .line 65
    .local v0, "answer":Ljava/lang/Object;, "TT;"
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$handler:Landroid/os/Handler;

    new-instance v6, Lcom/evernote/client/android/AsyncReflector$1$1;

    invoke-direct {v6, p0, v0}, Lcom/evernote/client/android/AsyncReflector$1$1;-><init>(Lcom/evernote/client/android/AsyncReflector$1;Ljava/lang/Object;)V

    invoke-virtual {v5, v6}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    goto :goto_46

    .line 60
    .end local v0    # "answer":Ljava/lang/Object;, "TT;"
    :cond_6b
    iget-object v5, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$receiver:Ljava/lang/Object;

    invoke-virtual {v5}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v5

    iget-object v6, p0, Lcom/evernote/client/android/AsyncReflector$1;->val$function:Ljava/lang/String;

    invoke-virtual {v5, v6, v1}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
    :try_end_76
    .catch Ljava/lang/Exception; {:try_start_48 .. :try_end_76} :catch_3b

    move-result-object v4

    goto :goto_58
.end method
